<?php

// Include
include_once('plugin/SmartyPlugin.php');
include_once('plugin/LoginPlugin.php');
include_once('plugin/AppConfigPlugin.php');
include_once('plugin/CommonPlugin.php');

// Para establecer locale en espanol (evita problemas como el formateo de la fecha de Smarty)
setlocale (LC_TIME,"spanish");

// Chequea si el usuario ya esta logueado
if (!LoginPlugin::isLogged()) {
	header( 'Location: index.php' );
	exit;		
}


// Ejecucion
$menuItems = AppConfigPlugin::getMenuItems();
$manageItems = AppConfigPlugin::getManageItems();
$appInfo = AppConfigPlugin::getAppInfo();
$iconsImg = AppConfigPlugin::getIconsImg();
$username = LoginPlugin::getUsername();


// Mensaje
$message = CommonPlugin::getMessage();
CommonPlugin::setMessage("");


// Creacion de Smarty
$smarty = SmartyPlugin::getSmarty();
$smarty->assign('menuItems', $menuItems);
$smarty->assign('manageItems', $manageItems);
$smarty->assign('appInfo', $appInfo);
$smarty->assign('iconsImg', $iconsImg);
$smarty->assign('username', $username);
$smarty->assign('message', $message);
